package com.linked.basemanage.permissioncontrol.service.impl;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.linked.basemanage.permissioncontrol.bean.po.RoleInfoPO;
import com.linked.basemanage.permissioncontrol.mapper.IRoleInfoMapper;
import com.linked.basemanage.permissioncontrol.service.IRoleInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author :dbq
 * @date : 2023/2/22 14:48
 * @description : desc
 */
@Slf4j
@Service
public class RoleInfoServiceImpl implements IRoleInfoService {

    private final ObjectMapper mapper;

    private final IRoleInfoMapper roleInfoMapper;

    @Autowired
    public RoleInfoServiceImpl(ObjectMapper mapper, IRoleInfoMapper roleInfoMapper) {
        this.mapper = mapper;
        this.roleInfoMapper = roleInfoMapper;
    }

    @Override
    public boolean addRole(RoleInfoPO param) throws Exception {
        return roleInfoMapper.insert(param) > 0;
    }
}
